home *** CD-ROM | disk | FTP | other *** search
- /*
- * main.c - main to test the stack abstraction
- */
-
- #include <stdio.h>
- #include <assert.h>
- #include <stack.h>
-
- char *some_pointer = "some data";
-
- void main() {
- STK *stk;
-
- stk = StkConstruct();
- assert(StkIsEmpty(stk));
- StkPush(stk, some_pointer);
- assert(!StkIsEmpty(stk));
- assert(StkPop(stk) == some_pointer);
- assert(StkIsEmpty(stk));
- StkDestroy(stk);
- }
-